-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add searchAfter interfaces to NativeSearchQueryBuilder #2106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- support searchAfter for nativeSearchQuery
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not use the SearchAfterIntegrationTests
to test this change. The change is on the NativeSearchQueryBuilder
and should be tested there. I know there is no test for this builder, but this might be a good opportunity to create it and just test that the searchAfter
values are set on the Query
after building it.
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.stream.Collectors; | ||
import java.util.stream.IntStream; | ||
|
||
import org.elasticsearch.search.sort.SortBuilders; | ||
import org.elasticsearch.search.sort.SortOrder; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This pulls in dependencies to Elasticsearch classes in this test, this test is independent of the used query type.
5b82f64
to
8f395c9
Compare
- add validate conditions in searchAfter() - cause SearchAfterBuilder.setSortValues() assert not allow empty values - delete not appropriate tests for searchAfter in SearchAfterIntegrationTests
8f395c9
to
a7129e9
Compare
@sothawo |
@@ -342,6 +344,15 @@ public NativeSearchQueryBuilder withSuggestBuilder(SuggestBuilder suggestBuilder | |||
return this; | |||
} | |||
|
|||
public NativeSearchQueryBuilder withSearchAfter(List<Object> searchAfter) { | |||
if (searchAfter != null && searchAfter.isEmpty()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since SearchAfterBuilder not allow empty collections (it throws illegalArgument exception)
i add this conditions for ignore empty collections
closes #2105